<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'userUpdatePassword-form',       
    //'enableClientValidation' => true,
    'enableAjaxValidation' => false,
	'type' => 'horizontal',
	'method' => 'post',
	'htmlOptions' => array(
		'enctype' => 'multipart/form-data'
	),
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
	
)); ?>
	
	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'oldPassword'); ?>
		<?php echo $form->passwordField($model,'oldPassword',array('size'=>20,'maxlength'=>20, 'style'=>'width:20ch')); ?>
		<?php echo $form->error($model,'oldPassword'); ?>
	</div>


	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'newPassword'); ?>
		<?php echo $form->passwordField($model,'newPassword',array('size'=>20,'maxlength'=>20, 'style'=>'width:20ch')); ?>
		<?php echo $form->error($model,'newPassword'); ?>
	</div>

	<div class="row">
		<?php echo CHtml::activeLabelEx($model,'rePassword'); ?>
		<?php echo $form->passwordField($model, 'rePassword',array('size'=>20,'maxlength'=>20, 'style'=>'width:20ch')); ?>
		<?php echo $form->error($model,'rePassword'); ?>
	</div>
	
	<?php  if(CCaptcha::checkRequirements()): ?>
        <div class="row">
            <?php echo CHtml::activeLabelEx($model, 'verifyCode'); ?>
        	<div class="captcha">
        		<?php $this->widget('CCaptcha'); ?><br/>
				<div class="hint">Ketik tulisan yang ada pada gambar .
				<br/>Tulisan tidak case sensitive</div>
        		<?php echo CHtml::activeTextField($model,'verifyCode'); ?>
				<?php echo $form->error($model,'verifyCode'); ?>
        	</div>
			
        </div>
	<?php endif; ?>
	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Buat' : 'Simpan');  ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php
	Yii::app()->clientScript->registerScript(
        'initCaptcha',
        '$(".captcha a").trigger("click");',
        CClientScript::POS_READY
    );
?>